package com.example06;

import com.example06.entity.Freighter;
import com.example06.entity.MyException;
import com.example06.resource.ContainerUtils;

import static com.example06.service.BusinessService.b;

public class Test {
    public static void main(String[] args) {
        Freighter freighter = new Freighter(1, "1号运输船", 500);
        try {
            b.isOverweight(freighter, ContainerUtils.listContainer());
            System.out.println(freighter.getName());
        }catch (MyException e) {
            System.out.println(e.getMessage());
        }finally {
            System.out.println("启航");
        }
    }
}
